import request from '@/utils/requestUtil'

export function activityByDate() {
	return request({
		method: 'GET',
		url: '/group/activity/activityByDate'
	})
}

// 根据当前拼团活动编号查询拼团商品
export function fetchActivityGoodsList(params) {
	return request({
		method: 'GET',
		url: '/group/goods/listByActivityId/'+params
	})
}
//
export function fetchWaitGroupList(skuId) {
	return request({
		method: 'GET',
		url: '/group/order/waitGroupList/'+ skuId,
	})
}
//用户发起拼单
//需要添加拼团订单表，拼团订单详情表
export function fetchNewProductList(params) {
	return request({
		method: 'POST',
		url: '/group/order/addGroupOrder',
		data:params
	})
}
export function generateGroupOrder(data) {
	return request({
		method: 'POST',
		url: '/group/order/genGroupOrder',
		data: data
	})
}
export function generateGroupOrderDetail(orderSn) {
	return request({
		method: 'POST',
		url: '/group/order/generateGroupOrderDetail/${orderSn}'
	})
}


export function fetchGroupOrderDetail(detailId) {
	return request({
		method: 'GET',
		url: `/group/detail/${detailId}`
	})
}
//团员参与拼团
export function joinGroup(orderSn) {
	return request({
		method: 'GET',
		url: `/group/detail/joinGroup/${orderSn}`
	})
}
